package util;

import generateConnections.GenerateConnectionBase;
import generateNodes.GenerateNodeBase;

import java.util.ArrayList;

import object.Node;

public class MappingUtil {
	public static void generateOneAtATime(ArrayList<Node> nodes, int numNodes, int numConn, int xSize, int ySize, GenerateNodeBase genNode, GenerateConnectionBase genConn){
		if(nodes.size()==0){
			for(int x = 0; x < numNodes; x++){
				Node curNode = genNode.genNodes(nodes, xSize, ySize);
				genConn.genConnections(nodes, curNode);
			}
			genNode.resetRandom();
			genConn.resetRandom();
		} else {
			ShuffleUtil<Node> s = new ShuffleUtil<Node>();
			s.Shuffle(nodes, Settings.getInstance().getSeed());
			for(Node n : nodes){
				genConn.genConnections(nodes, n);
			}
			genNode.resetRandom();
			genConn.resetRandom();
		}
	}
}
